FROM golang:latest
MAINTAINER sanxing

ADD build/sandbox/sim_2_89 /home/judge/sandbox/sim_2_89
ADD build/sandbox/judger/build/libjudger.so /usr/lib/judger/libjudger.so
ADD _output/judge-client /home/judge/judge-client
ADD config/app.ini /home/judge/app.ini
ADD logs /home/judge/logs
RUN  sed -i 's@http://deb.debian.org@http://mirrors.aliyun.com@g' /etc/apt/sources.list
RUN apt-get  update&&apt-get -u -y install \
    gcc g++\
    libseccomp-dev\
    cmake\
    make\
    python3\
    openjdk-11-jre


#RUN mkdir -p /home/judge
WORKDIR /home/judge
RUN mkdir -p  /home/judge/testcases /home/judge/submissions  /usr/lib/sim /usr/lib/sim/bin/arch


ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sim/bin:/usr/local/sim/bin/arch

#WORKDIR /home/judge/sandbox/sim_2_89
#RUN  chmod -R 777 /usr/lib/sim/bin
#RUN  chmod -R 777 /usr/lib/sim/bin/arch
#RUN  make install
RUN  chmod -R 777 /usr/lib/judger
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
CMD tail -f logs/run.log
EXPOSE 8090